<?php if(ADMIN){
if(@$_v['action']=='edit_post'||@$_v['action']=='edit_pag'||@$_v['action']=='add_post'||@$_v['action']=='new_pag'){
$if1=(($_v['action']=='edit_post'||$_v['action']=='add_post')?'window.onload=toggleArea;':'');
$if2=(($_v['action']=='edit_post'||$_v['action']=='add_post')?' checked="yes"':'');
	$_s['moremeta'].='
<script src="http://js.nicedit.com/nicEdit-latest.js" type="text/javascript"></script>
<script type="text/javascript">
var area1;
function toggleArea() {
	if(!area1) {
		area1 = new nicEditor({fullPanel : true,maxHeight: 400}).panelInstance(\'text\',{hasPanel : true});
	} else {
		area1.removeInstance(\'text\');
		area1 = null;
	}
}
'.$if1.'
</script>
	';
	$ptfdw .= '<div><input type="checkbox" onchange="toggleArea()"'.$if2.' id="nicedit" /> <label for="nicedit">nicedit</label> <sup>Не включать, если используется PHP-разметка.</sup></div>';
	}
}
?>
